<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Star {
            //类的共有属性放到constructor
            constructor(uname,song) {
                this.name = uname
                this.song = song
            }
            //公有方法
            dance (name) {
                console.log(name);
            }
            //静态方法
            static rap () { console.log('hello wrld');}
        }
        const cxk = new Star('ikun','知音')
        cxk.dance('打篮球')
        console.log(cxk);
    </script>
</body>
</html>